<%@language=vbscript%>
<%
	Session("FormName")="F25"
%>
<!--#include file="..\CheckSession.inc"-->
<!--#include file=..\getFormName.inc-->
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>
<LINK href="../styles/styles.css" type=text/css rel=STYLESHEET>
<%
bComm=request("bComm")
strdate=Request("bdate")
if strdate="" then
	strdate=date()
end if
bthu=weekday(strdate)
%>
<!--#include file="..\jvfunction.inc"-->
<BODY style="FONT-FAMILY: Time New Roman" topmargin=0 leftmargin=0 bgcolor=#f8f9d9 scroll="yes">
<form name=frm method=post>
<center>
<%
if bthu=1 then
	Txt="Ch&#7911; nh&#7853;t " & FormatDate(strdate)
else
	Txt="Th&#7913; " & bthu & " " & FormatDate(strdate)
end if	
%>
<%
sSQL="select tendonvi from donvi where madonvi='" & Session("bMaDonVi") & "'"
Set RecTen=server.CreateObject("ADODB.Recordset")
RecTen.CursorType=3
RecTen.CacheSize=5
RecTen.Open sSQL,Conn
if RecTen.RecordCount > 0 then
	btendonvi=RecTen("tendonvi")
end if
RecTen.close
Set RecTen=nothing
%>
<p align=center><table><TR><TD><font face='Time New Roman' color=blue><strong>Danh sách đăng ký lịch trực <%=btendonvi%> (<%=Txt%>)</strong></font></TD></TR></Table>
<table border="0" cellpadding="0" cellSpacing="0" width=100% bgColor="#EEEECC">
		<%
		sSQL="select canbo.hovaten,donvi.tendonvi from dktruc inner join canbo on dktruc.macanbo=canbo.macanbo inner join donvi on canbo.madonvi=donvi.madonvi and donvi.madonvi='" & Session("bMaDonVi") & "' where dktruc.ngaydangky='" & strdate & "' and dktruc.tttruc=1 and dktruc.ttdv=0"
		Set RecDK=server.CreateObject("ADODB.Recordset")
		RecDK.CursorType=3
		RecDK.CacheSize=5
		RecDK.Open sSQL,Conn
		Do while Not RecDK.EOF
			%>
			<tr>
			<td width=100% align="left"><INPUT readonly="true" name=hovaten value="<%=trim(RecDK("hovaten"))%>" size=25 maxlength=25 style="FONT-FAMILY: Time New Roman;font-size:11px;border: 1px solid #C0C0C0;width:100%"></td>
			</tr>
			<%
			RecDK.movenext
		loop
		RecDK.close
		set RecDK=nothing
	%>	
</TABLE>
</center>
</form>
</BODY>
</HTML>
<script language=vbscript runat=server>
Function FormatDate(vDate)
	   If Not IsNull(vDate) Then
	        vM = Right("0" & Month(vDate), 2)
	        vD = Right("0" & Day(vDate), 2)
	        vY = Right("19" & Year(vDate), 4)
	        FormatDate = vD & "/" & vM & "/" & vY
	   End If
End Function
Function SaveDate(vDate)
		dim bvitri1
		dim bvitri2
	   vDate=trim(cstr(vDate))
	   bvitri1=instr(1,vDate,"/")
	   bMonth=left(vDate,bvitri1-1)
	   bvitri2=instr(bvitri1+1,vDate,"/")
	   Dim Temp
	   Temp=right(vDate,len(vDate)-bvitri1)
	   bDay=left(Temp,bvitri2-bvitri1-1)
	   bYear=right(vDate,len(vDate)-bvitri2)
       SaveDate=bDay+"/"+bMonth+"/"+bYear
End Function
</script>
</HTML>